import home from 'views/home/main'

const routes = [
  {
    path: '/',
    name: 'home',
    component: home,
    meta: {
      keepAlive: false
    },
    redirect: '/index',
    children: [{
      path: 'index',
      name: 'index',
      component: () => import( /*webpackChunkName: "index"*/ 'views/home/index'),
      meta: {
        title: '商城首页',
      }
    },
      {
        path: 'cart',
        name: 'cart',
        component: () => import( /*webpackChunkName: "cart"*/ 'views/home/cart'),
        meta: {
          title: '购物车',
        }
      },
      {
        path: 'my',
        name: 'my',
        component: () => import( /*webpackChunkName: "my"*/ 'views/user/my'),
        meta: {
          title: '我的',
        }
      }
    ]
  },
  {
    path: '/goods/classify',
    name: 'classify',
    component: () => import( /*webpackChunkName: "classify"*/ 'views/home/goods/classify'),
    redirect: '/goods/classify/item',
    children: [{
      path: 'item',
      name: 'classifyItem',
      component: () => import( /*webpackChunkName: "classifyItem"*/ 'views/home/goods/classify_item'),
      meta: {
        title: '商品分类'
      }
    }]
  },
  {
    path: '/goods/search',
    name: 'goods-search',
    component: () => import( /*webpackChunkName: "goods-search"*/ 'views/home/goods/search'),
    meta: {
      title: '搜索商品'
    }
  },
  {
    path: '/goods/detail',
    name: 'goods-detail',
    component: () => import( /*webpackChunkName: "goods-detail"*/ 'views/home/goods/goods-detail'),
    redirect: {
      name: 'goods-item'
    },
    children: [{
      path: 'item',
      name: 'goods-item',
      component: () => import( /*webpackChunkName: "goods-item"*/ 'views/home/goods/goods-item'),
    },
      {
        path: 'content',
        name: 'goods-content',
        component: () => import( /*webpackChunkName: "goods-item"*/ 'views/home/goods/goods-content')
      },
      {
        path: 'review',
        name: 'goods-review',
        component: () => import( /*webpackChunkName: "goods-item"*/ 'views/home/goods/goods-review')
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import( /*webpackChunkName: "login"*/ 'views/user/login'),
    meta: {
      title: '会员登录'
    }
  },
  {
    path: '/reg',
    name: 'reg',
    component: () => import( /*webpackChunkName: "reg"*/ 'views/user/reg'),
    meta: {
      title: '会员注册'
    }
  },
  {
    path: '/user/profile',
    name: 'profile',
    component: () => import( /*webpackChunkName: "profile"*/ 'views/user/profile'),
    meta: {
      auth: true,
      title: '个人资料'
    }
  },
  {
    path: '/order',
    name: 'order',
    component: () => import( /*webpackChunkName: "order"*/ 'views/home/order'),
    meta: {
      auth: true,
      title: '确认订单'
    }
  },
  {
    path: '/order/success',
    name: 'order-success',
    component: () => import( /*webpackChunkName: "order-success"*/ 'views/home/order/success'),
    meta: {
      auth: true,
      title: '订单提交成功'
    }
  },
  {
    path: '/user/order',
    name: 'my-order',
    component: () => import( /*webpackChunkName: "my-order"*/ 'views/user/order'),
    meta: {
      auth: true
    },
    redirect: {
      name: 'order-list'
    },
    children: [{
      path: 'list',
      name: 'order-list',
      component: () => import( /*webpackChunkName: "order-list"*/ 'views/user/order/list'),
      meta: {
        auth: true
      }
    },
      {
        path: 'review',
        name: 'order-review',
        component: () => import( /*webpackChunkName: "order-review"*/ 'views/user/order/review'),
        meta: {
          auth: true
        }
      }
    ]
  },
  {
    path: '/user/order/add_review',
    name: 'add-review',
    component: () => import( /*webpackChunkName: "add-review"*/ 'views/user/order/add_review'),
    meta: {
      auth: true,
      title: '添加评价'
    }
  },
  {
    path: '/user/order/details',
    name: 'order-details',
    component: () => import( /*webpackChunkName: "order-details"*/ 'views/user/order/details'),
    meta: {
      auth: true,
      title: '订单详细信息'
    }
  },
  {
    path: '/address',
    name: 'address',
    component: () => import( /*webpackChunkName: "address"*/ 'views/home/address'),
    meta: {
      auth: true,
      title: '收货地址管理'
    }
  },
  {
    path: '/user/address',
    name: 'user-address',
    component: () => import( /*webpackChunkName: "user-address"*/ 'views/user/address'),
    meta: {
      auth: true,
      title: '收货地址'
    }
  },
  {
    path: '/user/address/mod',
    name: 'user-address-mod',
    component: () => import( /*webpackChunkName: "user-address-mod"*/ 'views/user/address/mod'),
    meta: {
      auth: true,
      title: '修改收货地址'
    }
  },
  {
    path: '/user/address/add',
    name: 'user-address-add',
    component: () => import( /*webpackChunkName: "user-address-add"*/ 'views/user/address/add'),
    meta: {
      auth: true,
      title: '添加收货地址'
    }
  },
  {
    path: '/address/add',
    name: 'address-add',
    component: () => import( /*webpackChunkName: "address-add"*/ 'views/home/address/add'),
    meta: {
      auth: true,
      title: '添加收货地址'
    }
  },
  {
    path: '/address/mod',
    name: 'address-mod',
    component: () => import( /*webpackChunkName: "address-mod"*/ 'views/home/address/mod'),
    meta: {
      auth: true,
      title: '修改收货地址'
    }
  },
  {
    path: '/user/cellphone',
    name: 'cellphone',
    component: () => import( /*webpackChunkName: "user-cellphone"*/ 'views/user/cellphone'),
    meta: {
      auth: true,
      title: '绑定手机'
    }
  },
  {
    path: '/user/password',
    name: 'password',
    component: () => import( /*webpackChunkName: "password"*/ 'views/user/password'),
    meta: {
      auth: true,
      title: '修改密码'
    }
  },
  {
    path: '/user/fav',
    name: 'fav',
    component: () => import( /*webpackChunkName: "fav"*/ 'views/user/fav'),
    meta: {
      auth: true,
      title: '我的收藏'
    }
  }
]
export default routes
